﻿//********************************************************************************//
//创建日期：<创建日期，2010-08-02>
//创建作者：<王一飞，wangyifei@shanghai3h.com>
//功能说明：YS_JH_QUEDINGJH实体层次
//********************************************************************************//

#region Entity

using System;
using System.Data;
using Entity;
using Oracle.DataAccess.Client;
using Platform.Configuration;
using Platform.Data;

namespace Entity
{
    [Serializable]
    public class YS_JH_QUEDINGJH
    {
        private decimal? m_dec_i_jlzt;

        private decimal? m_dec_i_m1;

        private decimal? m_dec_i_m10;

        private decimal? m_dec_i_m11;

        private decimal? m_dec_i_m12;

        private decimal? m_dec_i_m2;

        private decimal? m_dec_i_m3;

        private decimal? m_dec_i_m4;

        private decimal? m_dec_i_m5;

        private decimal? m_dec_i_m6;

        private decimal? m_dec_i_m7;

        private decimal? m_dec_i_m8;

        private decimal? m_dec_i_m9;

        private decimal? m_dec_i_type;

        private decimal? m_dec_i_y;

        private decimal m_dec_id;

        private DateTime? m_DT_d_caozuosj;

        private string m_str_s_beiyong1;

        private string m_str_s_beiyong2;

        private string m_str_s_caozuor;

        private string m_str_s_gongsibh;

        private string m_str_s_guanlikbh;

        private string m_str_s_jubianh;

        private string m_str_s_yonghuh;

        private string m_str_s_zhandianbh;

        /// <summary>
        ///     自增量
        /// </summary>
        public decimal ID
        {
            get { return m_dec_id; }
            set { m_dec_id = value; }
        }

        /// <summary>
        ///     站点
        /// </summary>
        public string S_ZHANDIANBH
        {
            get { return m_str_s_zhandianbh; }
            set { m_str_s_zhandianbh = value; }
        }

        /// <summary>
        ///     用户号
        /// </summary>
        public string S_YONGHUH
        {
            get { return m_str_s_yonghuh; }
            set { m_str_s_yonghuh = value; }
        }

        /// <summary>
        ///     年份
        /// </summary>
        public decimal? I_Y
        {
            get { return m_dec_i_y; }
            set { m_dec_i_y = value; }
        }

        /// <summary>
        ///     计划类型
        /// </summary>
        public decimal? I_TYPE
        {
            get { return m_dec_i_type; }
            set { m_dec_i_type = value; }
        }

        /// <summary>
        ///     管理块编号
        /// </summary>
        public string S_GUANLIKBH
        {
            get { return m_str_s_guanlikbh; }
            set { m_str_s_guanlikbh = value; }
        }

        /// <summary>
        ///     局编号
        /// </summary>
        public string S_JUBIANH
        {
            get { return m_str_s_jubianh; }
            set { m_str_s_jubianh = value; }
        }

        /// <summary>
        ///     公司编号
        /// </summary>
        public string S_GONGSIBH
        {
            get { return m_str_s_gongsibh; }
            set { m_str_s_gongsibh = value; }
        }

        /// <summary>
        ///     1月计划量
        /// </summary>
        public decimal? I_M1
        {
            get { return m_dec_i_m1; }
            set { m_dec_i_m1 = value; }
        }

        /// <summary>
        ///     2月计划量
        /// </summary>
        public decimal? I_M2
        {
            get { return m_dec_i_m2; }
            set { m_dec_i_m2 = value; }
        }

        /// <summary>
        ///     3月计划量
        /// </summary>
        public decimal? I_M3
        {
            get { return m_dec_i_m3; }
            set { m_dec_i_m3 = value; }
        }

        /// <summary>
        ///     4月计划量
        /// </summary>
        public decimal? I_M4
        {
            get { return m_dec_i_m4; }
            set { m_dec_i_m4 = value; }
        }

        /// <summary>
        ///     5月计划量
        /// </summary>
        public decimal? I_M5
        {
            get { return m_dec_i_m5; }
            set { m_dec_i_m5 = value; }
        }

        /// <summary>
        ///     6月计划量
        /// </summary>
        public decimal? I_M6
        {
            get { return m_dec_i_m6; }
            set { m_dec_i_m6 = value; }
        }

        /// <summary>
        ///     7月计划量
        /// </summary>
        public decimal? I_M7
        {
            get { return m_dec_i_m7; }
            set { m_dec_i_m7 = value; }
        }

        /// <summary>
        ///     8月计划量
        /// </summary>
        public decimal? I_M8
        {
            get { return m_dec_i_m8; }
            set { m_dec_i_m8 = value; }
        }

        /// <summary>
        ///     9月计划量
        /// </summary>
        public decimal? I_M9
        {
            get { return m_dec_i_m9; }
            set { m_dec_i_m9 = value; }
        }

        /// <summary>
        ///     10月计划量
        /// </summary>
        public decimal? I_M10
        {
            get { return m_dec_i_m10; }
            set { m_dec_i_m10 = value; }
        }

        /// <summary>
        ///     11月计划量
        /// </summary>
        public decimal? I_M11
        {
            get { return m_dec_i_m11; }
            set { m_dec_i_m11 = value; }
        }

        /// <summary>
        ///     12月计划量
        /// </summary>
        public decimal? I_M12
        {
            get { return m_dec_i_m12; }
            set { m_dec_i_m12 = value; }
        }

        /// <summary>
        ///     记录状态(0:正常;-1:逻辑删除)
        /// </summary>
        public decimal? I_JLZT
        {
            get { return m_dec_i_jlzt; }
            set { m_dec_i_jlzt = value; }
        }

        /// <summary>
        ///     备用1
        /// </summary>
        public string S_BEIYONG1
        {
            get { return m_str_s_beiyong1; }
            set { m_str_s_beiyong1 = value; }
        }

        /// <summary>
        ///     备用2
        /// </summary>
        public string S_BEIYONG2
        {
            get { return m_str_s_beiyong2; }
            set { m_str_s_beiyong2 = value; }
        }

        /// <summary>
        ///     操作人
        /// </summary>
        public string S_CAOZUOR
        {
            get { return m_str_s_caozuor; }
            set { m_str_s_caozuor = value; }
        }

        /// <summary>
        ///     操作时间
        /// </summary>
        public DateTime? D_CAOZUOSJ
        {
            get { return m_DT_d_caozuosj; }
            set { m_DT_d_caozuosj = value; }
        }
    }
}

#endregion

#region EntityProcess

namespace BLL.Access
{
    //using System.Data.OracleClient;

    public class YS_JH_QUEDINGJHProcess
    {
        #region Field

        protected string conn;

        #endregion

        #region Construction

        public YS_JH_QUEDINGJHProcess()
        {
            conn = ConfigHelper.PlatformConnString;
        }

        #endregion

        #region public

        /// <summary>
        ///     根据YS_JH_QUEDINGJH实体添加或者修改YS_JH_QUEDINGJH信息
        /// </summary>
        public bool InsertOrUpdate(YS_JH_QUEDINGJH YS_JH_QUEDINGJH, OracleTransaction Transaction)
        {
            if (YS_JH_QUEDINGJH.ID == 0)
                InsertYS_JH_QUEDINGJH(YS_JH_QUEDINGJH, Transaction);
            else
                UpdateYS_JH_QUEDINGJH(YS_JH_QUEDINGJH, Transaction);
            return YS_JH_QUEDINGJH.ID == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_JH_QUEDINGJH实体添加或修改YS_JH_QUEDINGJH信息
        /// </summary>
        public bool InsertOrUpdate(YS_JH_QUEDINGJH YS_JH_QUEDINGJH)
        {
            return InsertOrUpdate(YS_JH_QUEDINGJH, null);
        }


        /// <summary>
        ///     根据YS_JH_QUEDINGJH主键删除YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_JH_QUEDINGJH(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_JH_QUEDINGJH";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据YS_JH_QUEDINGJH主键删除YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="ID"></param>
        public bool DeleteYS_JH_QUEDINGJH(decimal ID)
        {
            return DeleteYS_JH_QUEDINGJH(ID, null);
        }

        /// <summary>
        ///     根据条件删除YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_JH_QUEDINGJHsDynamic(string WhereClause, OracleTransaction Transaction)
        {
            var spName = "CS_DelYS_JH_QUEDINGJHsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = WhereClause;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }

        /// <summary>
        ///     根据条件删除YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="WhereClause">条件子句(Oracle语句)不带where</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>如果删除成功，返回true,否则返回fals</returns>
        public bool DeleteYS_JH_QUEDINGJHsDynamic(string WhereClause)
        {
            return DeleteYS_JH_QUEDINGJHsDynamic(WhereClause, null);
        }

        /// <summary>
        ///     根据YS_JH_QUEDINGJH主键选择YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_QUEDINGJH信息</returns>
        public YS_JH_QUEDINGJH SelectYS_JH_QUEDINGJH(decimal ID, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_QUEDINGJH";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = ID;
            OracleDataReader rd;
            if (Transaction == null)
                rd = OracleHelper.ExecuteReader(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                rd = OracleHelper.ExecuteReader(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (rd.Read())
            {
                var YS_JH_QUEDINGJH = PopulateYS_JH_QUEDINGJH(rd);
                rd.Close();
                return YS_JH_QUEDINGJH;
            }
            return null;
        }

        /// <summary>
        ///     根据YS_JH_QUEDINGJH主键选择YS_JH_QUEDINGJH信息
        /// </summary>
        /// <returns>YS_JH_QUEDINGJH信息</returns>
        public YS_JH_QUEDINGJH SelectYS_JH_QUEDINGJH(decimal ID)
        {
            return SelectYS_JH_QUEDINGJH(ID, null);
        }

        /// <summary>
        ///     选择所有YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>所有YS_JH_QUEDINGJH信息</returns>
        public DataTable SelectYS_JH_QUEDINGJHsAll(OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_QUEDINGJHsAll";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }

        /// <summary>
        ///     选择所有YS_JH_QUEDINGJH信息
        /// </summary>
        /// <returns>所有YS_JH_QUEDINGJH信息</returns>
        public DataTable SelectYS_JH_QUEDINGJHsAll()
        {
            return SelectYS_JH_QUEDINGJHsAll(null);
        }

        /// <summary>
        ///     根据条件选择YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_QUEDINGJH信息</returns>
        public DataTable SelectYS_JH_QUEDINGJHsDynamic(string WhereClause, string OrderByExpression,
            OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_QUEDINGJHsDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <returns>YS_JH_QUEDINGJH信息</returns>
        public DataTable SelectYS_JH_QUEDINGJHsDynamic(string WhereClause, string OrderByExpression)
        {
            return SelectYS_JH_QUEDINGJHsDynamic(WhereClause, OrderByExpression, null);
        }


        /// <summary>
        ///     根据条件选择YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <param name="Transaction">事务，如果为null,则不做事务</param>
        /// <returns>YS_JH_QUEDINGJH信息</returns>
        public DataTable SelectYS_JH_QUEDINGJHsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize, OracleTransaction Transaction)
        {
            var spName = "CS_SelYS_JH_QUEDINGJHsDynPaged";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = string.IsNullOrEmpty(WhereClause.Trim()) ? "1=1" : WhereClause;
            storedParams[1].Value = OrderByExpression;
            storedParams[2].Value = PageIndex;
            storedParams[3].Value = PageSize;
            DataSet ds = null;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            if (ds != null && ds.Tables.Count > 0)
            {
                AddRowNumber(ds.Tables[0]);
                return ds.Tables[0];
            }
            return null;
        }


        /// <summary>
        ///     根据条件选择YS_JH_QUEDINGJH信息
        /// </summary>
        /// <param name="WhereClause">条件子句(不带where)</param>
        /// <param name="OrderByExpression">排序子句</param>
        /// <param name="PageIndex">页码</param>
        /// <param name="PageSize">页数</param>
        /// <returns>YS_JH_QUEDINGJH信息</returns>
        public DataTable SelectYS_JH_QUEDINGJHsDynamic(string WhereClause, string OrderByExpression, int PageIndex,
            int PageSize)
        {
            return SelectYS_JH_QUEDINGJHsDynamic(WhereClause, OrderByExpression, PageIndex, PageSize, null);
        }

        /// <summary>
        ///     根据条件更新YS_JH_QUEDINGJH字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_JH_QUEDINGJHsDynamic(string UpdateValue, string WhereClause, OracleTransaction Transaction)
        {
            var result = 0;
            if (UpdateValue == "" || WhereClause == "")
                return 0;
            var spName = "CS_UpdYS_JH_QUEDINGJHDyn";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            DataSet ds = null;
            storedParams[0].Value = UpdateValue;
            storedParams[1].Value = WhereClause;
            if (Transaction == null)
                ds = OracleHelper.ExecuteDataset(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                ds = OracleHelper.ExecuteDataset(Transaction, CommandType.StoredProcedure, spName, storedParams);
            result = Convert.ToInt32(storedParams[2].Value);
            return result;
        }

        /// <summary>
        ///     根据条件更新YS_JH_QUEDINGJH字段
        /// </summary>
        /// <returns>受影响行数</returns>
        public int UpdateYS_JH_QUEDINGJHsDynamic(string UpdateValue, string WhereClause)
        {
            return UpdateYS_JH_QUEDINGJHsDynamic(UpdateValue, WhereClause, null);
        }

        #endregion

        #region Private

        private int InsertYS_JH_QUEDINGJH(YS_JH_QUEDINGJH YS_JH_QUEDINGJH, OracleTransaction Transaction)
        {
            var spName = "CS_InsYS_JH_QUEDINGJH";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_JH_QUEDINGJH.S_ZHANDIANBH;
            storedParams[1].Value = YS_JH_QUEDINGJH.S_YONGHUH;
            storedParams[2].Value = YS_JH_QUEDINGJH.I_Y;
            storedParams[3].Value = YS_JH_QUEDINGJH.I_TYPE;
            storedParams[4].Value = YS_JH_QUEDINGJH.S_GUANLIKBH;
            storedParams[5].Value = YS_JH_QUEDINGJH.S_JUBIANH;
            storedParams[6].Value = YS_JH_QUEDINGJH.S_GONGSIBH;
            storedParams[7].Value = YS_JH_QUEDINGJH.I_M1;
            storedParams[8].Value = YS_JH_QUEDINGJH.I_M2;
            storedParams[9].Value = YS_JH_QUEDINGJH.I_M3;
            storedParams[10].Value = YS_JH_QUEDINGJH.I_M4;
            storedParams[11].Value = YS_JH_QUEDINGJH.I_M5;
            storedParams[12].Value = YS_JH_QUEDINGJH.I_M6;
            storedParams[13].Value = YS_JH_QUEDINGJH.I_M7;
            storedParams[14].Value = YS_JH_QUEDINGJH.I_M8;
            storedParams[15].Value = YS_JH_QUEDINGJH.I_M9;
            storedParams[16].Value = YS_JH_QUEDINGJH.I_M10;
            storedParams[17].Value = YS_JH_QUEDINGJH.I_M11;
            storedParams[18].Value = YS_JH_QUEDINGJH.I_M12;
            storedParams[19].Value = YS_JH_QUEDINGJH.I_JLZT;
            storedParams[20].Value = YS_JH_QUEDINGJH.S_BEIYONG1;
            storedParams[21].Value = YS_JH_QUEDINGJH.S_BEIYONG2;
            storedParams[22].Value = YS_JH_QUEDINGJH.S_CAOZUOR;
            storedParams[23].Value = YS_JH_QUEDINGJH.D_CAOZUOSJ;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            YS_JH_QUEDINGJH.ID = Convert.ToInt32(storedParams[24].Value);
            return result;
        }

        private bool UpdateYS_JH_QUEDINGJH(YS_JH_QUEDINGJH YS_JH_QUEDINGJH, OracleTransaction Transaction)
        {
            var spName = "CS_UpdYS_JH_QUEDINGJH";
            var storedParams = OracleHelperParameterCache.GetSpParameterSet(conn, spName);
            storedParams[0].Value = YS_JH_QUEDINGJH.S_ZHANDIANBH;
            storedParams[1].Value = YS_JH_QUEDINGJH.S_YONGHUH;
            storedParams[2].Value = YS_JH_QUEDINGJH.I_Y;
            storedParams[3].Value = YS_JH_QUEDINGJH.I_TYPE;
            storedParams[4].Value = YS_JH_QUEDINGJH.S_GUANLIKBH;
            storedParams[5].Value = YS_JH_QUEDINGJH.S_JUBIANH;
            storedParams[6].Value = YS_JH_QUEDINGJH.S_GONGSIBH;
            storedParams[7].Value = YS_JH_QUEDINGJH.I_M1;
            storedParams[8].Value = YS_JH_QUEDINGJH.I_M2;
            storedParams[9].Value = YS_JH_QUEDINGJH.I_M3;
            storedParams[10].Value = YS_JH_QUEDINGJH.I_M4;
            storedParams[11].Value = YS_JH_QUEDINGJH.I_M5;
            storedParams[12].Value = YS_JH_QUEDINGJH.I_M6;
            storedParams[13].Value = YS_JH_QUEDINGJH.I_M7;
            storedParams[14].Value = YS_JH_QUEDINGJH.I_M8;
            storedParams[15].Value = YS_JH_QUEDINGJH.I_M9;
            storedParams[16].Value = YS_JH_QUEDINGJH.I_M10;
            storedParams[17].Value = YS_JH_QUEDINGJH.I_M11;
            storedParams[18].Value = YS_JH_QUEDINGJH.I_M12;
            storedParams[19].Value = YS_JH_QUEDINGJH.I_JLZT;
            storedParams[20].Value = YS_JH_QUEDINGJH.S_BEIYONG1;
            storedParams[21].Value = YS_JH_QUEDINGJH.S_BEIYONG2;
            storedParams[22].Value = YS_JH_QUEDINGJH.S_CAOZUOR;
            storedParams[23].Value = YS_JH_QUEDINGJH.D_CAOZUOSJ;
            storedParams[24].Value = YS_JH_QUEDINGJH.ID;
            var result = 0;
            if (Transaction == null)
                result = OracleHelper.ExecuteNonQuery(conn, CommandType.StoredProcedure, spName, storedParams);
            else
                result = OracleHelper.ExecuteNonQuery(Transaction, CommandType.StoredProcedure, spName, storedParams);
            return result == 0 ? false : true;
        }


        private YS_JH_QUEDINGJH PopulateYS_JH_QUEDINGJH(IDataReader dr)
        {
            var YS_JH_QUEDINGJH = new YS_JH_QUEDINGJH();
            YS_JH_QUEDINGJH.ID = dr["ID"] == DBNull.Value ? 0 : (decimal) dr["ID"];
            YS_JH_QUEDINGJH.S_ZHANDIANBH = dr["S_ZHANDIANBH"] == DBNull.Value ? null : (string) dr["S_ZHANDIANBH"];
            YS_JH_QUEDINGJH.S_YONGHUH = dr["S_YONGHUH"] == DBNull.Value ? null : (string) dr["S_YONGHUH"];
            YS_JH_QUEDINGJH.I_Y = dr["I_Y"] == DBNull.Value ? null : (decimal?) dr["I_Y"];
            YS_JH_QUEDINGJH.I_TYPE = dr["I_TYPE"] == DBNull.Value ? null : (decimal?) dr["I_TYPE"];
            YS_JH_QUEDINGJH.S_GUANLIKBH = dr["S_GUANLIKBH"] == DBNull.Value ? null : (string) dr["S_GUANLIKBH"];
            YS_JH_QUEDINGJH.S_JUBIANH = dr["S_JUBIANH"] == DBNull.Value ? null : (string) dr["S_JUBIANH"];
            YS_JH_QUEDINGJH.S_GONGSIBH = dr["S_GONGSIBH"] == DBNull.Value ? null : (string) dr["S_GONGSIBH"];
            YS_JH_QUEDINGJH.I_M1 = dr["I_M1"] == DBNull.Value ? null : (decimal?) dr["I_M1"];
            YS_JH_QUEDINGJH.I_M2 = dr["I_M2"] == DBNull.Value ? null : (decimal?) dr["I_M2"];
            YS_JH_QUEDINGJH.I_M3 = dr["I_M3"] == DBNull.Value ? null : (decimal?) dr["I_M3"];
            YS_JH_QUEDINGJH.I_M4 = dr["I_M4"] == DBNull.Value ? null : (decimal?) dr["I_M4"];
            YS_JH_QUEDINGJH.I_M5 = dr["I_M5"] == DBNull.Value ? null : (decimal?) dr["I_M5"];
            YS_JH_QUEDINGJH.I_M6 = dr["I_M6"] == DBNull.Value ? null : (decimal?) dr["I_M6"];
            YS_JH_QUEDINGJH.I_M7 = dr["I_M7"] == DBNull.Value ? null : (decimal?) dr["I_M7"];
            YS_JH_QUEDINGJH.I_M8 = dr["I_M8"] == DBNull.Value ? null : (decimal?) dr["I_M8"];
            YS_JH_QUEDINGJH.I_M9 = dr["I_M9"] == DBNull.Value ? null : (decimal?) dr["I_M9"];
            YS_JH_QUEDINGJH.I_M10 = dr["I_M10"] == DBNull.Value ? null : (decimal?) dr["I_M10"];
            YS_JH_QUEDINGJH.I_M11 = dr["I_M11"] == DBNull.Value ? null : (decimal?) dr["I_M11"];
            YS_JH_QUEDINGJH.I_M12 = dr["I_M12"] == DBNull.Value ? null : (decimal?) dr["I_M12"];
            YS_JH_QUEDINGJH.I_JLZT = dr["I_JLZT"] == DBNull.Value ? null : (decimal?) dr["I_JLZT"];
            YS_JH_QUEDINGJH.S_BEIYONG1 = dr["S_BEIYONG1"] == DBNull.Value ? null : (string) dr["S_BEIYONG1"];
            YS_JH_QUEDINGJH.S_BEIYONG2 = dr["S_BEIYONG2"] == DBNull.Value ? null : (string) dr["S_BEIYONG2"];
            YS_JH_QUEDINGJH.S_CAOZUOR = dr["S_CAOZUOR"] == DBNull.Value ? null : (string) dr["S_CAOZUOR"];
            YS_JH_QUEDINGJH.D_CAOZUOSJ = dr["D_CAOZUOSJ"] == DBNull.Value ? null : (DateTime?) dr["D_CAOZUOSJ"];
            return YS_JH_QUEDINGJH;
        }


        private void AddRowNumber(DataTable dt)
        {
            dt.Columns.Add(new DataColumn("RowNumber", typeof(int)));
            for (var i = 0; i < dt.Rows.Count; i++)
                dt.Rows[i][dt.Columns.Count - 1] = i + 1;
        }

        #endregion
    }
}

#endregion